﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Collections;
using haptic.src.engine.debug;

namespace haptic.src.engine.render
{
    public class CameraManager
    {
        #region Constructors
        public CameraManager()
        {
        }
        #endregion

        #region Edit
        public void Add(string sCamera, Camera oCamera)
        {
            if (m_oCameras.ContainsKey(sCamera))
            {
                Log.Error("Cannot add '" + sCamera + "' camera");
            }
            else
                m_oCameras.Add(sCamera, oCamera);
        }
        public void Remove(string sCamera)
        {
            m_oCameras.Remove(sCamera);
        }
        #endregion

        #region Update
        public void Update(GameTime oGameTime)
        {
            if (m_oCurrent != null)
                m_oCurrent.Update(oGameTime);
        }
        #endregion

        #region Accessors
        public Camera GetCurrent()
        {
            return m_oCurrent;
        }
        public void SetCurrent(string sCamera)
        {
            if (!m_oCameras.ContainsKey(sCamera))
            {
                Log.Error("Camera '" + sCamera + "' does not exit in the camera manager");
            }
            else
                m_oCurrent = (Camera)m_oCameras[sCamera];
        }
        #endregion

        #region Attributes
        private Hashtable m_oCameras = new Hashtable();
        private Camera m_oCurrent;
        #endregion
    }
}
